package edu.sctu.liangyuxiang.day20150517;

/**
 * Created by user20 on 2015/5/17.
 */
public class TextMore {
    Teacher[] teacher = new Teacher[3];
    Student[] student = new Student[9];
    public Teacher[] sortNumber() {
        for (int i = 0; i <teacher.length-1 ; i++) {
            for (int j = 1; j < teacher.length; j++) {
                if (teacher[i].number > teacher[j].number) {
                    Teacher teacher1;
                    teacher1 = teacher[i];
                    teacher[i] = teacher[j];
                    teacher[j] = teacher1;
                }
            }
        }
        return teacher;
    }

    public Student[] sortStudent() {
        for (int i = 0; i <teacher.length ; i++) {
            for (int j = 0; j <student.length ; j++) {
                if(teacher[i].student[j].score > teacher[i].student[j+1].score){
                    Student student1;
                    student1 = teacher[i].student[j];
                    teacher[i].student[j] = teacher[i].student[j+1];
                    teacher[i].student[j+1] = student1;
                }
            }
        }
        return student;
    }

    public Teacher[] pritCoded(){
        Teacher teacher3;
        for (int i = 0; i <teacher.length ; i++) {
            if (teacher[i].title.equals("教授")) {
                teacher3 = teacher[i];
            }
        }
        return teacher;
    }
}
